#include<stdio.h>
#include<sys/types.h>
#include<unistd.h>
#include<string.h>
#include<sys/stat.h>
#include<fcntl.h>
int main()
{
	umask(0);
	//int fd = open("888.txt",O_WRONLY | O_CREAT | O_APPEND,0666);
	int fd = open("888.txt",O_RDONLY | O_CREAT | O_APPEND,0666);
	if(fd<0)
	{
		printf("error!\n");
		return 1;
	}
	printf("%d",fd);
	char s[512];
	read(fd,s,512);
	//write(fd,s,strlen(s));
	printf("%s",s);
	close(fd);
	return 0;
}
